/**
 * 
 */
package czolgisci.display;

import java.awt.Component;
import java.awt.Image;
import java.util.Iterator;

import utils.time.IClockListener;

import czolgisci.events.TickEvent;


/**
 * @author kasztan
 * 
 */
public class DisplayManager implements IClockListener
{
	static private DisplayManager instance;

	private Component drawField;
	private Iterator<Image> imageIterator;

	private DisplayManager()
	{
		
	}
	
	public void init(Iterator<Image> imageIter, Component drawField)
	{
		this.drawField = drawField;
		this.imageIterator = imageIter;
	}
	
	public void render() throws Exception
	{
		if(drawField == null)
		{
			throw new Exception("drawField not defined");
		}
		drawField.wait(); //to remove
		imageIterator.getClass();
	}

	static public DisplayManager getInstance()
	{
		if (instance == null)
		{
			instance = new DisplayManager();
		}
		return instance;
	}

	public void setDrawField(Component frame)
	{
		drawField = frame;
	}
	
	public Component getDrawField()
	{
		return drawField;
	}

	public void onTick(TickEvent e)
	{
		// TODO Auto-generated method stub
		
	}


}
